package demo2;

/**
 * Created with IntelliJ IDEA.
 * User: 12629
 * Date: 2022/2/24
 * Time: 21:04
 * Description:
 */
//抽象类:不是一个具体的类
abstract class Shape {
   /* public int count;
    public static int a;
    public void test() {
        System.out.println("fdsfaa");
    }*/

    /*public String name; 这个普通的属性  要么使用构造方法初始化 要么使用get set

    public Shape(String name) {
        this.name = name;
    }*/

    public abstract  void draw();//抽象方法

}

class Cycle extends Shape {
    /*public Cycle(String name) {
        super(name);
    }*/
    @Override
    public void draw() {
        System.out.println("画●！");
    }
}
class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("画♦！");
    }
}
class Flower extends Shape {
    @Override
    public void draw() {
        System.out.println("画❀！");
    }
}
class Triangle extends Shape {
    @Override
    public void draw() {
        System.out.println("画△！");
    }
}
/*abstract class Rect extends Shape {
    public abstract void test22();
}
class A extends Rect {

    @Override
    public void draw() {

    }

    @Override
    public void test22() {

    }
}*/

public class TestDemo {
    public static void drawMap(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        Cycle cycle = new Cycle();
        drawMap(cycle);
        drawMap(new Rect());
        drawMap(new Flower());
        drawMap(new Triangle());
    }
}
